package top.yudoge.dogeeditor.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import top.yudoge.dogeeditor.domain.DeKnowledge;

import java.util.List;

@Mapper
public interface DeKnowledgeMapper {

    @Insert("INSERT INTO de_knowledge(original_chat_history, create_time) VALUES(#{originalChatHistory}, #{createTime})")
    void insert(DeKnowledge deKnowledge);

    @Select("SELECT id, original_chat_history, create_time FROM de_knowledge")
    List<DeKnowledge> selectAll();

    @Delete("DELETE FROM de_knowledge WHERE id = #{id}")
    void delete(Long id);

}
